package b;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-05-29
 * Time: 14:13
 */
//测试类
public class Test {
    public static void main(String[] args) {

    }
    public static void main2(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        System.out.println("请输入二叉排序树的节点个数:");
        Scanner scanner =new Scanner(System.in);
        int number = scanner.nextInt();
        System.out.println("请输入要插入的节点:");
        for (int i = 0; i < number; i++) {
            int val = scanner.nextInt();
            binarySearchTree.insert(val);
        }
        System.out.println("请输入要查找的值:");
        int elem = scanner.nextInt();
        System.out.print("查找次数: ");
        System.out.println(binarySearchTree.search(elem));

    }
}
